Coding Tutorials Blog

Ruby on Rails Reference - CLI Commands, Bundler, Macros

October 22, 2020

My Learning Ruby on Rails Video Playlist: https://www.youtube.com/playlist?list=PLY6oTPmKnKbYlAqVHgzZl5lou54bizdbV

Gems

Gems are Ruby Libraries, and the gem command is like npm in the nodeJS world. Here are some of the main Gem commands.

Gems

Bundler

Keeping track of which Gems are used in a project can be tricky. Similar to package.json in Node you have a Gemfile that lists a projects dependencies. With bundler you can make sure all these Gems are installed.

Bundler

Ruby on Rails CLI

The Ruby on Rails CLI has several commands to make assembling your rails project very easy. Here are some of those commands.

Rails Commands Part I

Rails Commands Part II

Rails Commands Part III

Rails Commands Part III

Active Record Types

Active Record is the ORM that Ruby on Rails uses to work with SQL databases. When using generator commands you can specify fields and types to quickly generate models and migrations. Here are the many Active Record types.

Active Record Types

Model Macros

In your models there are several macros that help add features and functionality to your models.

Rails Model Macros

Route Macros

Macros for Routes

Route Macros


© alexmercedcoder.dev 2020